//
//  Emoticon.swift
//  Emoticon
//
//  Created by 李锡鹏 on 2017/6/10.
//  Copyright © 2017年 李锡鹏. All rights reserved.
//

import Foundation
class Emoticon:NSObject{
    // 表情文字
    var chs: String?
    // 表情图片
    var png: String?
    // emoji
    var emoji:String?
    // emoji编码
    var code: String? {
        didSet {
            emoji = code?.emoji
        }
    }
    var imagePath:String? {
        if png == nil
        {
            return ""
        }
        else
        {
            return Bundle.main.bundlePath + "/Emoticons.bundle/" + png!
        }
    }
    // 是否删除按钮
    var isRemoved :Bool = false
    var isEmpty :Bool = false
    init(dict:[String:AnyObject]) {
        super.init()
        setValuesForKeys(dict)
    }
    init(isRemoved:Bool) {
        super.init()
        self.isRemoved = isRemoved
    }
    init(isEmpty:Bool) {
        super.init()
        self.isEmpty = isEmpty
    }
    override func setValue(_ value: Any?, forUndefinedKey key: String) {}
    override var description: String {
        let keys = ["chs","png","code"]
        return dictionaryWithValues(forKeys: keys).description
    }
}
